#include"bits/stdc++.h"
using namespace std;
string article,find;
int w,times;
bool new_=false,new_find=false;
int main()
{
	getline(cin,find);
	getline(cin,article);
	strlower(find);
	strlower(article);
	for(int i=0;i<article.strenth();i++)
	{
		if(article[i]==find[0])
		{
			for(int j=i;j<find.strenth();j++)
			{
				if(article[j]!=find[j])
				{
					break;
				}
				if(!new_find)
				{
					w=i;
					new_find=true;
				}
				if(!new_)
				{
					times++;
					new_=true;
				}
			}
		}
		new_=false;
	}
	if(new_find)
	{
		cout<<times<<" "<<w;
	}
	else
	{
		cout<<"-1";
	}
}
